import { RouteRecordRaw } from 'vue-router'
export const constantRoute: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'login',
        meta: {
            title: '用户登录',
        },
        component: () => import('@/views/userLogin/login/index.vue'),
    },
    {
        path: '/register',
        name: 'register',
        meta: {
            title: '用户注册',
        },
        component: () => import('@/views/userLogin/Register/index.vue'),
    },
    {
        path: '/HelloWorld',
        name: 'HelloWorld',
        meta: {
            title: '欢迎界面',
        },
        component: () => import('@/components/HelloWorld.vue'),
    },
    {
        path: '/home',
        name: 'home',
        meta: {
            title: '新闻首页',
        },
        component: () => import('@/views/home/index.vue'),
    },
    {
        path: '/read',
        name: 'read',
        meta: {
            title: '阅读',
        },
        component: () => import('@/views/Read/index.vue'),
    },
    {
        path: '/search',
        name: 'search',
        meta: {
            title: '搜索',
        },
        component: () => import('@/views/Search/index.vue'),
    },
    {
        path: '/user-center',
        name: 'user-center',
        meta: {
            title: '个人中心',
        },
        component: () => import('@/views/userCenter/index.vue'),
        redirect:'/user-center/user-info',
        children:[
            {
                path: 'manage-news',
                name: 'manageNews',
                meta: {
                    title: '管理新闻',
                },
                component: () => import('@/views/userCenter/manageNews/index.vue'),
            },
            {
                path: 'user-info',
                name: 'userInfo',
                meta: {
                    title: '个人信息',
                },
                component: () => import('@/views/userCenter/userInfo/index.vue'),
            },
            {
                path: 'publish-new',
                name: 'publishNew',
                meta: {
                    title: '发布新闻',
                },
                component: () => import('@/views/userCenter/publishNew/index.vue'),
            }
        ]
    },

]
export const asyncRoute: RouteRecordRaw[] = []
export const anyRoute: RouteRecordRaw[] = [
    {
        // //任意路由
        // path: '/:pathMatch(.*)*',
        // redirect: '/404',
        // name: 'Any',
        // meta: {
        //     title: '任意路由',
        //     hidden: true,
        //     icon: 'DataLine',
        // },
    },
]
